import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '所属检查项',
    align: "center",
    dataIndex: 'checkItemId_dictText'
  },
  {
    title: '是否为否决项',
    align: "center",
    dataIndex: 'isReject_dictText'
  },
  {
    title: '扣分分值',
    align: "center",
    dataIndex: 'deductPoint'
  },
  {
    title: '扣分说明',
    align: "center",
    dataIndex: 'deductIllustrate'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "所属检查项",
    field: 'checkItemId',
    component: 'JSearchSelect',
    componentProps:{
      dict: "tb_base_check_item,check_content,id"
    },
    //colProps: {span: 6},
  },
  {
    label: "是否为否决项",
    field: 'isReject',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "yn"
    },
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '所属检查项',
    field: 'checkItemId',
    component: 'JSearchSelect',
    componentProps:{
      dict: "tb_base_check_item,check_content,id"
    },
  },
  {
    label: '是否为否决项',
    field: 'isReject',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "yn"
    },
  },
  {
    label: '扣分分值',
    field: 'deductPoint',
    component: 'InputNumber',
  },
  {
    label: '扣分说明',
    field: 'deductIllustrate',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  checkItemId: {title: '所属检查项',order: 0,view: 'sel_search', type: 'string',dictTable: 'tb_base_check_item', dictCode: 'id', dictText: 'check_content',},
  isReject: {title: '是否为否决项',order: 1,view: 'radio', type: 'string',},
  deductPoint: {title: '扣分分值',order: 2,view: 'number', type: 'number',},
  deductIllustrate: {title: '扣分说明',order: 3,view: 'text', type: 'string',},
};
